package com.lin.sppringbootdemo.config;

import com.lin.sppringbootdemo.Inteceptor.MyInteceptor1;
import com.lin.sppringbootdemo.Inteceptor.MyInteceptor2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Autowired
    private MyInteceptor1 myInteceptor1;

    @Autowired
    private MyInteceptor2 myInteceptor2;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(myInteceptor1).addPathPatterns("/*");
        registry.addInterceptor(myInteceptor2).addPathPatterns("/*");
    }



}
